package com.ego.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ego.common.vo.PageVo;
import com.ego.product.po.SkuInfo;
import com.ego.product.vo.DetailVo;
import com.ego.product.vo.SkuFilterConditionVo;
import com.ego.product.vo.SkuFilteredVo;
import com.ego.product.vo.SkuInfoSearchVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author KamTang
 * @program: ego
 * @description sku信息服务层
 * @date 2022-11-13 12:56:14
 */
public interface SkuInfoService extends IService<SkuInfo> {
    /**
     * 搜索商品Sku信息
     * @param search @see
     * @return sku信息
     * @see SkuInfoSearchVo
     */
    PageVo<SkuInfo> search(SkuInfoSearchVo search);

    /**
     * 过滤其他sku，满足用户选择的分类下和品牌
     * @param filter @see SkuFilterConditionVo
     * @return @see SkuFilteredVo
     * @see SkuFilterConditionVo
     * @see SkuFilteredVo
     */
    List<SkuFilteredVo> filter(SkuFilterConditionVo filter);

    /**
     * 根据spuId获取sku信息
     * @param spuId spuId
     * @return @see
     * @see SkuInfo
     */
    List<SkuInfo> getBySpuId(Long spuId);

    /**
     * 根据id获取详情
     * @param skuId id
     * @return @see
     * @throws ExecutionException 异步任务可能产生的异常
     * @throws InterruptedException 异步任务可能产生的异常
     * @see DetailVo
     */
    DetailVo detail(Long skuId) throws ExecutionException, InterruptedException;
}

